#ifndef __Scene_RenderManager_h__
#define __Scene_RenderManager_h__

#include "Core/BasicTypes.h"
#include <vector>
#include <map>

namespace Orca {

	class GfxDriver;
	class RenderQueue;
	class IRenderQueueSorter;

	//--------------------------------------------------------------------------
	class RenderManager {

	public:
		RenderManager(GfxDriver *gfxDriver);
		~RenderManager();

		void render(uint16 startQueueId, uint16 stopQueueId);

		void registerRenderQueue(uint16 id, IRenderQueueSorter *sorter);
		void unregisterRenderQueue(uint16 id);
		RenderQueue* getRenderQueue(uint16 id);

	private:
		GfxDriver *mGfxDriver;

		typedef std::map<uint16, RenderQueue*> TRQMapping;
		typedef std::vector<RenderQueue*> TRQList;

		TRQMapping mRQMapping;
		TRQList mRQList;

		void _refreshRQList();

	};
}

#endif	// __Scene_RenderManager_h__